/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <iostream>
#include <deque>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <string>
using namespace std;
void show(auto &container)
{
    for(auto element:container)
    {
        cout << element << " ";
    }
    cout << endl;
}
int main_28()
{
    srand((unsigned int)time(nullptr));
    deque<int> int_deq;
    int random_int;
    for (int i=0; i<30 ; ++i )
    {
        random_int=rand()%10;
        int_deq.push_back(random_int);
    }
    show(int_deq);
    auto iter=search_n(int_deq.begin(),int_deq.end(),2,4);
    if (iter!=int_deq.end())
    {
        cout << "search a sub-sequence 44 in the position "<<distance(int_deq.begin(),iter) << endl;
    }
    else
    {
        cout << "There isn't a sub-sequence 44 in the container" << endl;
    }
    iter=search_n(int_deq.begin(),int_deq.end(),2,4,greater_equal<int>());
    if (iter!=int_deq.end())
    {
        cout << "search 2 consecutive numbers greater than or equal to 4 in the position "<<distance(int_deq.begin(),iter) << endl;
    }
    else
    {
        cout << "There isn't 2 consecutive numbers greater than or equal to 4 in the container" << endl;
    }
    return 0;
}
